package net.hn.hnms.biz.plan.service;

import net.hn.hnms.biz.plan.domain.DispatchKeepWatchPerson;
import net.hn.hnms.biz.plan.request.DispatchKeepWatchDutyReq;
import net.hn.hnms.biz.plan.request.DispatchKeepWatchLeadReq;
import net.hn.hnms.biz.plan.request.DispatchKeepWatchReq;
import net.hn.hnms.biz.plan.request.UpdateDutyLDReq;
import net.hn.hnms.biz.plan.vo.DispatchKeepWatchVO;
import net.hn.hnms.sys.common.core.domain.ResponsePage;
import net.hn.hnms.sys.common.mybatis.core.page.PageQuery;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.Date;
import java.util.List;

/**
 * @author zhaoyang
 * 带值班管理服务层
 * @date 2022-08-02
 */
public interface IDispatchKeepWatchService {

    /**
     *
     * @param dispatchKeepWatch
     * @param pageQuery
     * 分页查询带值班列表
     */
    ResponsePage<DispatchKeepWatchVO> selectPageList(DispatchKeepWatchReq dispatchKeepWatch, PageQuery pageQuery);


    /**
     *
     * @param dispatchKeepWatch
     * 查询带值班列表
     */
    List<DispatchKeepWatchVO> selectList(DispatchKeepWatchReq dispatchKeepWatch);

    /**
     *
     * @param leadReq
     * 新增带班
     */
    int insertLead(DispatchKeepWatchLeadReq leadReq);
    int insertLeadLD(DispatchKeepWatchLeadReq leadReq);


    /**
     *
     * @param dutyReq
     * 新增值班
     */
    int insertDuty(DispatchKeepWatchDutyReq dutyReq);
    int insertDutyLD(UpdateDutyLDReq dutyReq);

    /**
     *
     * @param idList
     * 批量删除 id集合
     */
    void deleteBatch(List<String> idList);

    /**
     *
     * @param dispatchKeepWatch
     * 单个更新 根据id主键 更新带值班详情
     */
    void updateById(DispatchKeepWatchReq dispatchKeepWatch);


    /**
     *
     * @param id
     * 通过主键id 查询详情
     */
    DispatchKeepWatchVO selectDetailById(String id);

    /**
     * 启用/禁用
     */
    void changeStatus(DispatchKeepWatchReq dispatchKeepWatch);

    /**
     *
     * 获取当天值班人员
     */
    List<DispatchKeepWatchPerson> getPersonByToday();


    /**
     * 自动排班
     * @param beginDate 时间范围
     * @param endDate 时间范围
     * @param number 人数
     * @return List<DispatchKeepWatchVO> 排班信息
     */
    List<DispatchKeepWatchVO> automatic(Date beginDate,Date endDate, Integer number);


    List<DispatchKeepWatchVO> automatictwo(Date beginDate) throws ParseException;
    List<DispatchKeepWatchVO> automaticLD(Date beginDate) throws ParseException;


    List<DispatchKeepWatchVO> automaticgty(Date beginDate,String mineCode) throws ParseException;

    /**
     * 自动排班结果保存
     * @param reqs 自动排班结果保存
     */
    void automaticAdd(List<DispatchKeepWatchReq> reqs);



    List<DispatchKeepWatchVO> leadShiftList( String beginDate,String mineCode);
    DispatchKeepWatchVO getOnDutyPersonnel( String beginDate,String mineCode);

    List<DispatchKeepWatchVO> leadShiftListGty( String beginDate,String mineCode);


    List<DispatchKeepWatchVO> dutyShiftList(String beginDate,String mineCode);


    List<DispatchKeepWatchVO> leadShiftStatistics(String beginDate,String mineCode);


    List<DispatchKeepWatchVO> dutyShiftStatistics(String beginDate, String mineCode);


    void exportLeadData(HttpServletResponse response, String beginDate,String mineCode);

    void exportDutyData(HttpServletResponse response, String beginDate);

    /**
     *
     * @param dispatchKeepWatch
     * 单个更新 根据id主键 更新带值班详情
     */
    boolean updateDutyById(DispatchKeepWatchReq dispatchKeepWatch);
    boolean updateDutyByIdLD(UpdateDutyLDReq updateDutyLDReq);


    boolean updateLeadById(DispatchKeepWatchReq dispatchKeepWatch);
    boolean updateLeadLDById(DispatchKeepWatchReq dispatchKeepWatch);

    void emptyLead(DispatchKeepWatchReq dispatchKeepWatch);


    void emptyDuty(DispatchKeepWatchReq dispatchKeepWatch);



    void exportLeadDataGty(HttpServletResponse response, String beginDate,String mineCode);


    boolean updateLeadGtyById(DispatchKeepWatchReq dispatchKeepWatch);



    DispatchKeepWatchVO getOnDutyPersonnelOfLD( String beginDate,String mineCode);

    void importResult(MultipartFile file, String mineCode);

    /**
     * 自动排班-核桃裕
     * @param beginDate 时间范围
     * @return List<DispatchKeepWatchVO> 排班信息
     */
    List<DispatchKeepWatchVO> automaticHTY(Date beginDate, String mineCode);
}
